package com.zj;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;

import java.io.IOException;
import java.io.InputStream;
import java.util.Properties;

@SpringBootApplication
public class Hello3Application {

    public static void main(String[] args) throws IOException {
        SpringApplication springApplication = new SpringApplication(Hello3Application.class);
        InputStream asStream = Hello3Application.class.getClassLoader().getResourceAsStream("app1.properties");
        Properties properties = new Properties();
        properties.load(asStream);
        springApplication.setDefaultProperties(properties);

        springApplication.setAddCommandLineProperties(false);//如果不希望将命令行属性添加到环境中 ，可以使用 SpringApplication.setAddCommandLineProperties(false) 禁用它们。
        springApplication.run(args);

//        SpringApplication.run(Hello3Application.class, args);
    }

}
